<!--
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html lang="en" ng-app="CDash">
  <head ng-controller="HeadController">
    <meta charset="UTF-8">
    <meta name="robots" content="noindex,nofollow" />
    <link rel="shortcut icon" href="favicon.ico" />
    <link rel="stylesheet" type="text/css" ng-href="build/css/{{cssfile}}_@@version.css" />
    <link rel="stylesheet" type="text/css" href="css/nv.d3.css"/>
    <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"/>
    <link rel="stylesheet" type="text/css" href="css/jquery-ui-1.10.4.css" />
    <script src="js/CDash_@@version.min.js"></script>
    <title ng-bind="title">CDash : Build Properties</title>
  </head>

  <body bgcolor="#ffffff" ng-controller="BuildPropertiesController">
-->

    <div ng-if="cdash.requirelogin == 1" ng-include="'login.php'"></div>
    <ng-include ng-if="cdash.requirelogin != 1" src="cdash.header || 'build/views/partials/header_@@version.html'"></ng-include>
    <br/>

    <div id="main_content" ng-if="cdash.requirelogin != 1 && !loading && !cdash.error" class="container">

      <h4 class="text-center">Consider builds unclean if they contain any</h4>
      <div class="row">
        <div class="text-center">
          <label class="checkbox-inline"
                 ng-repeat="defecttype in ::cdash.defecttypes track by $index">
            <input type="checkbox" value="" ng-model="defecttype.selected"> {{::defecttype.prettyname}}
          </label>
        </div>
      </div>
      <!-- Timeline chart -->
      <div timeline></div>

      <div ng-if="::cdash.builds.length == 0">
        <div class="row spacer50">
          <p class="col-md-12">
            No builds found during this time period.
          </p>
        </div>
      </div>

      <div ng-if="::cdash.builds.length > 0">
        <h4 class="text-center spacer50">Query Build Properties</h4>

        <div id="chart" class="row">
          <svg style="height:500px"></svg>
        </div>

        <div ng-repeat="selection in cdash.selections" class="animate-show">
          <div class="row">
            <div class="form-inline text-center">
              <div class="form-group">
                <label>Define Selection</label>
                <input type="text" class="form-control" placeholder="Selection Name" ng-model="selection.name"/>
              </div>
            </div>
          </div>
          <div class="form-inline text-center">
            <input type="text" class="form-control" placeholder="Property"
                   ng-model="selection.property"
                   ng-change="updateComparators(selection)"
                   auto-complete available-values="cdash.propertykeys" />
            <select class="form-control"
                    ng-model="selection.comparator"
                    ng-options="obj.text for obj in selection.comparators | orderBy:'pos' track by obj.symbol">
              <option value="" disabled selected hidden>Comparator</option>
            </select>
            <input type="text" class="form-control" placeholder="Value" ng-model="selection.value"/>
            <button type="submit" class="btn btn-default"
                    ng-click="applySelection(selection)"
                    ng-disabled="!selection.name || !selection.property || !selection.comparator || !selection.value">Apply</button>
            <button type="submit" class="btn btn-default"
                    ng-click="removeSelection(selection)"
                    ng-disabled="!selection.applied">-</button>
          </div>
          <div ng-show="selection.error" class="text-danger">
            <b>Error applying selection: {{selection.error}}</b>
          </div>
        </div>

        <div class="text-center">
          <p class="spacer50">
            <button type="button" class="btn btn-default"
                    ng-click="toggleDefects()">
              <span ng-show="!cdash.showDefects">Show Defects</span>
              <span ng-show="cdash.showDefects">Hide Defects</span>
            </button>
          </p>

          <img id="spinner" src="img/loading.gif" ng-show="cdash.loadingDefects" />

          <div ng-show="cdash.defectsError" class="text-danger">
            <b>Error: {{cdash.defectsError}}</b>
          </div>

          <p ng-show="cdash.showDefects && cdash.defects.length == 0">
            No defects found.
          </p>

          <div class="animate-show"
               ng-show="cdash.showDefects && cdash.defects.length > 0">
            <table class="table table-striped">
              <th class="text-center col-md-4" ng-click="updateOrderByFields('descr', $event)">
                <span class="glyphicon"
                      ng-class="orderByFields.indexOf('-descr') != -1 ? 'glyphicon-chevron-down' : (orderByFields.indexOf('descr') != -1 ? 'glyphicon-chevron-up' : 'glyphicon-none')">
                </span>
                Description
              </th>
              <th class="text-center col-md-2" ng-click="updateOrderByFields('type', $event)">
                <span class="glyphicon"
                      ng-class="orderByFields.indexOf('-type') != -1 ? 'glyphicon-chevron-down' : (orderByFields.indexOf('type') != -1 ? 'glyphicon-chevron-up' : 'glyphicon-none')">
                </span>
                Type
              </th>
              <th class="text-center col-md-2" ng-click="updateOrderByFields('builds.length', $event)">
                <span class="glyphicon"
                      ng-class="orderByFields.indexOf('-builds.length') != -1 ? 'glyphicon-chevron-down' : (orderByFields.indexOf('builds.length') != -1 ? 'glyphicon-chevron-up' : 'glyphicon-none')">
                </span>
                Number of Builds
              </th>
              <th class="text-center col-md-4" class="text-center">
                What's causing this?
              </th>
              <tr ng-repeat="defect in pagination.filteredDefects"
                  ng-class-od="'odd'" ng-class-even="'even'">
                <td class="text-center">{{::defect.descr}}</td>
                <td class="text-center">{{::defect.type}}</td>
                <td class="text-center">{{::defect.builds.length}}</td>
                <td class="text-center">
                  <span class = "glyphicon"
                        style="cursor: pointer"
                        ng-class = "defect.showClassifiers ? 'glyphicon-eye-close' : 'glyphicon-eye-open'"
                        ng-click="toggleClassifiers(defect)"></span>
                  <img id="spinner" src="img/loading.gif"
                       ng-show="defect.loadingClassifiers" />
                  <table ng-show="defect.showClassifiers && !defect.loadingClassifiers"
                         class="table table-condensed animate-show"
                         style="background-color: inherit">
                    <th class="text-center">Condition</th>
                    <th class="text-center">Correlation</th>
                    <tr ng-repeat="entry in defect.classifiers | orderBy: '-accuracy' | limitTo: 3">
                      <td class="text-center">{{entry.classifier}}</td>
                      <td class="text-center">{{entry.accuracy}}%</td>
                    </tr>
                  </table>
                  <span ng-show="defect.showClassifiers && !defect.loadingClassifiers && defect.classifiers.length > 3"
                        ng-click="showModal(defect)"
                        class="animate-show"
                        style="cursor: pointer">
                    More...
                  </span>
                </td>
              </tr>
            </table>
            <div ng-if="::cdash.defects.length > 25">
              <uib-pagination
                ng-model="pagination.currentPage"
                total-items="cdash.defects.length"
                max-size="pagination.maxSize"
                items-per-page="pagination.numPerPage"
                ng-change="pageChanged()"
                boundary-links="true">
              </uib-pagination>
              <div>
                <label>Items per page</label>
                <select name="itemsPerPage"
                        convert-to-number
                        ng-model="pagination.numPerPage"
                        ng-change="numDefectsPerPageChanged()">
                  <option value="25">25</option>
                  <option value="50">50</option>
                  <option value="100">100</option>
                  <option value="-1">All</option>
                </select>
              </div>
            </div>
          </div>
        </div>

      </div>
    </div>

    <!-- Modal to show correlation between defects and properties -->
    <script type="text/ng-template" id="modal-template">
      <div class="modal-header">
        <h4 class="modal-title text-center">Properties Associated With Defect</h4>
      </div>
      <div class="modal-body">
        <p class="text-center">
          <b>{{cdash.currentDefect.type}}</b>: {{cdash.currentDefect.descr}}
        </p>
        <table class="table table-striped table-condensed">
          <th>Condition</th>
          <th>Correlation</th>
          <tr ng-repeat="entry in cdash.currentDefect.classifiers | orderBy: '-accuracy'">
            <td>{{entry.classifier}}</td>
            <td>{{entry.accuracy}}%</td>
          </tr>
        </table>
      </div>
      <div class="modal-footer">
        <button class="btn btn-primary" id="dismiss-modal-button" ng-click="$ctrl.ok()">OK</button>
      </div>
    </script>

    <!-- FOOTER -->
    <br/>
    <ng-include ng-if="cdash.requirelogin != 1" src="cdash.footer || 'build/views/partials/footer_@@version.html'"></ng-include>
<!--

  </body>
</html>
-->
